//
//  UIViewController+BGRouter.m
//  BGRoutes
//
//  Created by chenguibang on 2017/3/7.
//  Copyright © 2017年 chenguibang. All rights reserved.
//
#import <objc/runtime.h>
#import "UIViewController+BGRouter.h"
static char *BGRouterKey = "BGRouterKey";
@implementation UIViewController(BGRouter)
-(BGRouteManager *)routeManager{
   return  objc_getAssociatedObject(self, &BGRouterKey);
}
-(void)setRouteManager:(BGRouteManager *)routeManager{
    objc_setAssociatedObject(self, &BGRouterKey, routeManager, OBJC_ASSOCIATION_RETAIN);
}

-(void)routeTo:(NSString *)path object:(NSObject *)object{
    Class rou = NSClassFromString(@"RouteController");
   id ui = [[rou alloc]init];
    ((UIViewController*)ui).view.backgroundColor = [UIColor redColor];
    ((UIViewController*)ui).view.frame = self.view.bounds;
    [self presentViewController:ui animated:YES completion:^{
        
    }];
}

@end
